package com.woniu.mealsService.mapper;

import com.woniu.mealsService.model.StoreFileUpload;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
 * <p>
 * 商铺文件上传表 Mapper 接口
 * </p>
 *
 * @author jiang
 * @since 2024年12月09日
 */
@Mapper
public interface StoreFileUploadMapper extends BaseMapper<StoreFileUpload> {
    @Update("update store_file_upload set file_upload_id = #{fileUploadId} where file_path=#{filePath}")
    Integer bindFileUploadId(@Param("fileUploadId")Long fileUploadId,@Param("filePath") String filePath);
    @Select("select * from store_file_upload where file_upload_id=#{fileUploadId}")
    StoreFileUpload searchStoreFileUploadById(@Param("fileUploadId")Long fileUploadId);
    @Update("update store_file_upload set size=#{storeFileUpload.size},file_path=#{storeFileUpload.filePath},file_name=#{storeFileUpload.fileName},file_suffix=#{storeFileUpload.fileSuffix},update_time=#{storeFileUpload.updateTime},update_user=#{storeFileUpload.updateUser} where file_upload_id=#{storeFileUpload.fileUploadId}")
    Integer updateFile(@Param("storeFileUpload") StoreFileUpload storeFileUpload);
}
